import request from '@/utils/request'

// 查询操作指南列表
export function listInstruction(query) {
  return request({
    url: '/operate/instruction/list',
    method: 'get',
    params: query
  })
}

// 查询操作指南详细
export function getInstruction(id) {
  return request({
    url: '/operate/instruction/' + id,
    method: 'get'
  })
}

// 新增操作指南
export function addInstruction(data) {
  return request({
    url: '/operate/instruction',
    method: 'post',
    data: data
  })
}

// 修改操作指南
export function updateInstruction(data) {
  return request({
    url: '/operate/instruction',
    method: 'put',
    data: data
  })
}

// 删除操作指南
export function delInstruction(id) {
  return request({
    url: '/operate/instruction/' + id,
    method: 'delete'
  })
}


// 查询操作指南详细
export function getInstructionRecently() {
  return request({
    url: '/operate/instruction/getInstructionRecently',
    method: 'get'
  })
}

export function changeInstructionStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/operate/instruction/updateStatus',
    method: 'post',
    data: data
  })
}
